<ui:composition template="/template/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="centerbody">
		<p:panelGrid columns="3">
			<p:outputLabel value="Campo"></p:outputLabel>
			<p:outputLabel value="Valor"></p:outputLabel>
			<p:outputLabel value="Alerta"></p:outputLabel>
			<p:outputLabel value=" Login: "></p:outputLabel>
			<p:inputText id="nome" label="Login" value="#{usersBean.appUser.idlogin}"></p:inputText>
			<p:message id="message_nome" for="nome" style="color: red" />
			<p:outputLabel value=" Senha: "></p:outputLabel>
			<p:inputText id="password" label="Senha" value="#{usersBean.appUser.idpassword}">
			<f:ajax event="keyup" execute="password" render="message" ></f:ajax>
			<f:validateLength minimum="5" maximum="10"></f:validateLength>
			</p:inputText>
			<p:message id="message" for="password" style="color: red" />
			<p:commandButton update="userslist" value="+"
				action="#{usersBean.addUser}"></p:commandButton>
		</p:panelGrid>
		<p:dataTable id="userslist" resizableColumns="true"
			style="padding-top:10px" var="appuser"
			value="#{usersBean.appUsers}">
			<p:column headerText="cduser">
				<h:outputText value="#{appuser.cduser}" />
			</p:column>
			<p:column headerText="Login">
				<h:outputText value="#{appuser.idlogin}" />
			</p:column>
			<p:column headerText="password">
				<h:outputText value="#{appuser.idpassword}" />
			</p:column>
			<p:column headerText="Remover">
				<p:commandButton value="-" update="userslist"
					action="#{usersBean.removeUser(appuser)}"></p:commandButton>
			</p:column>
		</p:dataTable>
	</ui:define>
</ui:composition>


